calculate sigma